package com.jfs.qy.config.component;

import com.jfs.qy.enums.AlertEventEnum;
import lombok.Data;

import java.io.Serializable;

/**
 * @Description 自定告警事件对象
 * @E-mail cwm3412638@163.com
 * @Author cwm
 * @Date 2022/11/4
 */
@Data
public class AlarmEvent implements Serializable {

    /**
     * 事件类型
     */
    private AlertEventEnum alertEventEnum;
    /**
     * 产生事件的通道名称
     */
    private String channelName;
    /**
     * 产生事件的通道ip地址
     */
    private String ip;
    /**
     * 事件名称
     */
    private String name;

    /**
     * 告警事件
     */
    private String time;

    /**
     * 告警类型
     */
    private Integer type;

    /**
     * 私有构造
     */
    private AlarmEvent(Builder builder) {
        this.alertEventEnum = builder.alertEventEnum;
        this.channelName = builder.channelName;
        this.ip = builder.ip;
        this.name = builder.name;
        this.time = builder.time;
        this.type = builder.type;
    }


    public static final class Builder {
        public Builder() {
        }

        private AlertEventEnum alertEventEnum;

        private String channelName;

        private String ip;

        private String name;

        private String time;

        private Integer type;
        public Builder alertEventEnum(AlertEventEnum alertEventEnum) {
            this.alertEventEnum = alertEventEnum;
            return this;
        }

        public Builder channelName(String channelName) {
            this.channelName = channelName;
            return this;
        }

        public Builder ip(String ip) {
            this.ip = ip;
            return this;
        }

        public Builder name(String name) {
            this.name = name;
            return this;
        }

        public Builder time(String time) {
            this.time = time;
            return this;
        }

        public Builder type(Integer type) {
            this.type = type;
            return this;
        }
        public AlarmEvent build() {
            return new AlarmEvent(this);
        }
    }
}
